package com.oo.exception_5.userDefinedException;

/**
 * People--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-10 15:35
 **/
public class People {

    private String sex;

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        if ("男".equals(sex) || "女".equals(sex)) {
            this.sex = sex;
        } else {
            throw new GenderException("性别必须为男或者女");
        }

    }
}
